home *** CD-ROM | disk | FTP | other *** search
Wrap
XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) NNNNAAAAMMMMEEEE _X_m_Q_T_m_e_n_u_S_y_s_t_e_m - A widget holding this trait can serve as a menu system SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS #include <Xm/MenuT.h> typedef struct { int version; XmMenuSystemTypeProc type; XmMenuSystemStatusProc status; XmMenuSystemCascadeProc cascade; XmMenuSystemVerifyProc verifyButton; XmMenuSystemControlTraversalProc controlTraversal; XmMenuSystemMenuBarCleanupProc menuBarCleanup; XmMenuSystemPopdownProc popdown; XmMenuSystemPopdownProc buttonPopdown; XmMenuSystemReparentProc reparentToTearOffShell; XmMenuSystemReparentProc reparentToMenuShell; XmMenuSystemArmProc arm; XmMenuSystemDisarmProc disarm; XmMenuSystemTearOffArmProc tearOffArm; XmMenuSystemEntryCallbackProc entryCallback; XmMenuSystemUpdateHistoryProc updateHistory; XmMenuSystemGetPostedFromWidgetProc getLastSelectToplevel; XmMenuSystemPositionProc position; XmMenuSystemUpdateBindingsProc updateBindings; XmMenuSystemRecordPostFromWidgetProc recordPostFromWidget; XmMenuSystemPopdownAllProc popdownEveryone; XmMenuSystemChildFocusProc childFocus; XmMenuSystemPopupPostedProc getPopupPosted; } XmMenuSystemTraitRec, *XmMenuSystemTrait; #define XmMenuSystemTypeProc XmMenuSystemWidgetProc #define XmMenuSystemStatusProc XmMenuSystemWidgetProc #define XmMenuSystemMenuBarCleanupProc XmMenuSystemDisarmProc #define XmMenuSystemReparentProc XmMenuSystemPositionProc #define XmMenuSystemArmProc XmMenuSystemDisarmProc #define XmMenuSystemTearOffArmProc XmMenuSystemDisarmProc #define XmMenuSystemGetPostedFromWidgetProc XmMenuSystemDisarmProc #define XmMenuSystemPopdownAllProc XmMenuSystemPositionProc #define XmMenuSystemChildFocusProc XmMenuSystemDisarmProc vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmCCCCaaaassssccccaaaaddddeeeePPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt****, BBBBoooooooolllleeeeaaaannnn ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmVVVVeeeerrrriiiiffffyyyyPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt****, vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmCCCCoooonnnnttttrrrroooollllTTTTrrrraaaavvvveeeerrrrssssaaaallllPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, BBBBoooooooolllleeeeaaaannnn, Page 1 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) BBBBoooooooolllleeeeaaaannnn ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmPPPPooooppppddddoooowwwwnnnnPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt****, vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmDDDDiiiissssaaaarrrrmmmmPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmEEEEnnnnttttrrrryyyyCCCCaaaallllllllbbbbaaaacccckkkkPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt, XXXXttttPPPPooooiiiinnnntttteeeerrrr, BBBBoooooooolllleeeeaaaannnn ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmUUUUppppddddaaaatttteeeeHHHHiiiissssttttoooorrrryyyyPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt, BBBBoooooooolllleeeeaaaannnn, vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmPPPPoooossssiiiittttiiiioooonnnnPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt****, vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmUUUUppppddddaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggssssPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, iiiinnnntttt, vvvvooooiiiidddd ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmRRRReeeeccccoooorrrrddddPPPPoooossssttttFFFFrrrroooommmmWWWWiiiiddddggggeeeettttPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt, BBBBoooooooolllleeeeaaaannnn, WWWWiiiiddddggggeeeetttt ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmPPPPooooppppuuuuppppPPPPoooosssstttteeeeddddPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt, iiiinnnntttt ((((****XXXXmmmmMMMMeeeennnnuuuuSSSSyyyysssstttteeeemmmmWWWWiiiiddddggggeeeettttPPPPrrrroooocccc))))( WWWWiiiiddddggggeeeetttt); VVVVEEEERRRRSSSSIIIIOOOONNNN This page documents Motif 2.1. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN A widget holding the _X_m_Q_T_m_e_n_u_S_y_s_t_e_m trait can be configured as a menu system. In the standard Motif widget set, only the XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget holds this trait. The _X_m_Q_T_m_e_n_u_S_y_s_t_e_m trait provides many trait methods. If you are writing a menu child widget, then you will need to call some of these trait methods. For example, the _E_x_m_M_e_n_u_B_u_t_t_o_n demonstration widget uses the following trait methods of _X_m_Q_T_m_e_n_u_S_y_s_t_e_m: +o ssssttttaaaattttuuuussss +o cccchhhhiiiillllddddFFFFooooccccuuuussss +o rrrreeeeppppaaaarrrreeeennnnttttTTTTooooTTTTeeeeaaaarrrrOOOOffffffffSSSShhhheeeellllllll +o bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnn +o ggggeeeettttLLLLaaaassssttttSSSSeeeelllleeeeccccttttTTTTooooppppLLLLeeeevvvveeeellll Page 2 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) +o eeeennnnttttrrrryyyyCCCCaaaallllllllbbbbaaaacccckkkk +o vvvveeeerrrriiiiffffyyyyBBBBuuuuttttttttoooonnnn +o ccccoooonnnnttttrrrroooollllTTTTrrrraaaavvvveeeerrrrssssaaaallll +o ggggeeeettttPPPPooooppppuuuuppppPPPPoooosssstttteeeedddd +o tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmm +o ppppooooppppddddoooowwwwnnnnEEEEvvvveeeerrrryyyyoooonnnneeee +o ppppooooppppddddoooowwwwnnnn We do not recommend writing your own menu manager widget. All the primitive button widgets and button gadgets in the standard Motif widget set call trait methods of _X_m_Q_T_m_e_n_u_S_y_s_t_e_m. TTTThhhheeee ttttyyyyppppeeee TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd iiiinnnntttt ttttyyyyppppeeee( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); The _t_y_p_e trait method returns the kind of menu system (for example, a Pulldown menu) that widget _r_o_w_C_o_l_u_m_n_W_i_d_g_e_tis managing. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the parent widget that is managing the menu system. Typically, _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is the parent widget of the current widget. This trait method returns the type of menu. The returned type must be one of the following: XXXXmmmmWWWWOOOORRRRKKKK____AAAARRRREEEEAAAA, XXXXmmmmMMMMEEEENNNNUUUU____BBBBAAAARRRR, XXXXmmmmMMMMEEEENNNNUUUU____PPPPUUUULLLLLLLLDDDDOOOOWWWWNNNN, XXXXmmmmMMMMEEEENNNNUUUU____PPPPOOOOPPPPUUUUPPPP, or XXXXmmmmMMMMEEEENNNNUUUU____OOOOPPPPTTTTIIIIOOOONNNN. TTTThhhheeee ssssttttaaaattttuuuussss TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd iiiinnnntttt ssssttttaaaattttuuuussss( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); The _s_t_a_t_u_s trait method returns the current status of certain menu operations. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget that is managing the menu system. Typically, _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is the parent widget of the current widget. This trait method returns a bit mask symbolizing the current status of certain menu operations. The XXXXmmmm////XXXXmmmmPPPP....hhhh header file provides widget writers with the following macros for Page 3 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) interpreting the returned mask: XmIsTorn(_m_a_s_k) This macro returns a nonzero value if the menu has already been torn off. Otherwise, this macro returns 0. XmIsTearOffShellDescendant(_m_a_s_k) This macro returns a nonzero value if the menu is a descendant of the tear-off shell. Otherwise, this macro returns 0. XmPopupPosted(_m_a_s_k) This macro returns a nonzero value if the menu is a Popup menu that has already been posted. Otherwise, this macro returns 0. XmIsInDragMode(_m_a_s_k) This macro returns a nonzero value if the menu is in drag mode. Otherwise, this macro returns 0. TTTThhhheeee ccccaaaassssccccaaaaddddeeee TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd ccccaaaassssccccaaaaddddeeee( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt ccccaaaassssccccaaaaddddeeeeBBBBuuuuttttttttoooonnnnWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); We do not recommend writing your own cascade button widget; however, if you do, then your cascade button widget must call the _c_a_s_c_a_d_e trait method. More specifically, your cascade button widget must call _c_a_s_c_a_d_e immediately prior to performing the menu cascade itself. The _c_a_s_c_a_d_e trait method records the data causing the cascade. Furthermore, the trait method positions the submenu. Note that this trait method does not actually perform the menu cascade itself. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the submenu to post. _c_a_s_c_a_d_e_B_u_t_t_o_n_W_i_d_g_e_t Specifies the cascade button widget that is about to be cascaded. _e_v_e_n_t Specifies a pointer to the event causing the menu cascade. TTTThhhheeee vvvveeeerrrriiiiffffyyyyBBBBuuuuttttttttoooonnnn TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd BBBBoooooooolllleeeeaaaannnn vvvveeeerrrriiiiffffyyyyBBBBuuuuttttttttoooonnnn( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); Page 4 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) A child button widget calls the vvvveeeerrrriiiiffffyyyyBBBBuuuuttttttttoooonnnn trait method to determine whether _e_v_e_n_t is supposed to cause menu posting. The event that is supposed to cause menu posting is defined by the XXXXmmmmNNNNmmmmeeeennnnuuuuPPPPoooosssstttt resource of the parent XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the parent XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget that holds the menu posting event. _e_v_e_n_t Specifies a pointer to the event received by the child button widget that is to be verified. This trait method returns _T_r_u_e if the _e_v_e_n_t matches the menu posting specification defined by the XXXXmmmmNNNNmmmmeeeennnnuuuuPPPPoooosssstttt resource of _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t. Otherwise, it returns _F_a_l_s_e. TTTThhhheeee ccccoooonnnnttttrrrroooollllTTTTrrrraaaavvvveeeerrrrssssaaaallll TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd ccccoooonnnnttttrrrroooollllTTTTrrrraaaavvvveeeerrrrssssaaaallll( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, BBBBoooooooolllleeeeaaaannnn ttttrrrraaaavvvveeeerrrrsssseeee); We do not recommend writing your own cascade button widget; however, if you do, then your cascade button widget will call ccccoooonnnnttttrrrroooollllTTTTrrrraaaavvvveeeerrrrssssaaaallll to control traversal within the MenuBar. This trait method turns menu traversal on or off. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the RowColumn widget that will handle traversal. _t_r_a_v_e_r_s_e This is a BBBBoooooooolllleeeeaaaannnn value. Ordinarily, this should be set to False. Specifying _F_a_l_s_e establishes default Motif traversal behavior within a MenuBar, which is to say that traversal is disabled. Specifying _T_r_u_e enables menu traversal within the MenuBar. TTTThhhheeee mmmmeeeennnnuuuuBBBBaaaarrrrCCCClllleeeeaaaannnnuuuupppp TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd mmmmeeeennnnuuuuBBBBaaaarrrrCCCClllleeeeaaaannnnuuuupppp( WWWWiiiiddddggggeeeetttt mmmmeeeennnnuuuuBBBBaaaarrrrWWWWiiiiddddggggeeeetttt); A user may invoke the <<<<oooossssffffMMMMeeeennnnuuuuBBBBaaaarrrr>>>> action of XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn(typically, by pressing the F10 function key) to activate traversal within the MenuBar. When the user invokes <<<<oooossssffffMMMMeeeennnnuuuuBBBBaaaarrrr>>>> a second time to deactivate menu traversal, the XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn needs to "clean up" the MenuBar. This cleanup involves lowering any Pulldown or Popup menus. In the standard Motif widget set, XXXXmmmmCCCCaaaassssccccaaaaddddeeeeBBBBuuuuttttttttoooonnnn and XXXXmmmmCCCCaaaassssccccaaaaddddeeeeBBBBuuuuttttttttoooonnnnGGGGaaaaddddggggeeeettttboth call the mmmmeeeennnnuuuuBBBBaaaarrrrCCCClllleeeeaaaannnnuuuupppp trait method. Page 5 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) _m_e_n_u_B_a_r_W_i_d_g_e_t Specifies the menubar widget (typically, an XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget) that needs to be cleaned up. TTTThhhheeee ppppooooppppddddoooowwwwnnnn TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd BBBBoooooooolllleeeeaaaannnn ppppooooppppddddoooowwwwnnnn( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); The ppppooooppppddddoooowwwwnnnn trait method pops down all the Popup menus associated with the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t. This trait method is similar to the bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnntrait method. Your widget should call ppppooooppppddddoooowwwwnnnnif _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is in a tear-off shell. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the parent widget (typically, an XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget) that is managing the Popup menus. _e_v_e_n_t Specifies a pointer to the event causing the popdown. This trait method returns _T_r_u_e if _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t was managing any Popup menus. Otherwise, it returns _F_a_l_s_e. TTTThhhheeee bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnn TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd BBBBoooooooolllleeeeaaaannnn bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnn( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); The bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnn trait method pops down all the Popup menus associated with the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t. This trait method is similar to the bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnntrait method. Your widget should call ppppooooppppddddoooowwwwnnnnif _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is not in a tear-off shell. The bbbbuuuuttttttttoooonnnnPPPPooooppppddddoooowwwwnnnn trait method provides a slight delay between the time the user presses the button and the popdown occurs. This delay gives the widget time to draw visuals that simulate the button being pressed. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the Popup menu widget that needs to be popped down. _e_v_e_n_t Specifies the event that caused the popdown. This trait method returns _T_r_u_e if the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t was managing any Popup menus. Otherwise, returns _F_a_l_s_e. TTTThhhheeee rrrreeeeppppaaaarrrreeeennnnttttTTTTooooTTTTeeeeaaaarrrrOOOOffffffffSSSShhhheeeellllllll TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd rrrreeeeppppaaaarrrreeeennnnttttTTTTooooTTTTeeeeaaaarrrrOOOOffffffffSSSShhhheeeellllllll( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); Page 6 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) When a user tears off a tear-off menu, the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t holding the menu needs to be reparented. In other words, the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_tthat was a child of the MenuBar must now become a child of the tear-off shell. In order to do this, the child button widget calls the rrrreeeeppppaaaarrrreeeennnnttttTTTTooooTTTTeeeeaaaarrrrOOOOffffffffSSSShhhheeeellllllll trait method. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the menu to reparent. _e_v_e_n_t Specifies a pointer to the event that caused the tear off. TTTThhhheeee rrrreeeeppppaaaarrrreeeennnnttttTTTTooooMMMMeeeennnnuuuuSSSShhhheeeellllllll TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd rrrreeeeppppaaaarrrreeeennnnttttTTTTooooMMMMeeeennnnuuuuSSSShhhheeeellllllll( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); When a user collapses a tear-off shell, the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t holding the menu needs to be reparented. That is, the menu inside the tear-off shell must become a child of the MenuBar. Therefore, when the user collapses a tear-off shell, the child button widget (typically, a cascade button widget) must call rrrreeeeppppaaaarrrreeeennnnttttTTTTooooMMMMeeeennnnuuuuSSSShhhheeeellllllll. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the menu to reparent. _e_v_e_n_t Specifies a pointer to the event causing the tear-off shell to collapse. TTTThhhheeee aaaarrrrmmmm TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd aaaarrrrmmmm( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); A cascade button widget must call the _a_r_m trait method as part of its AAAArrrrmmmm or AAAArrrrmmmmAAAAnnnnddddAAAAccccttttiiiivvvvaaaatttteeee method. More precisely, a cascade button widget must call _a_r_m whenever the user posts a Pulldown method. If _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is not already armed, then the _a_r_m trait method makes current the calling widget and saves the focus widget. If _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is already armed, then the _a_r_m trait method does nothing. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget to arm. The XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget must have the XXXXmmmmNNNNrrrroooowwwwCCCCoooolllluuuummmmnnnnTTTTyyyyppppeeee resource set to XXXXmmmmMMMMEEEENNNNUUUU____BBBBAAAARRRR. TTTThhhheeee ddddiiiissssaaaarrrrmmmm TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd ddddiiiissssaaaarrrrmmmm( Page 7 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); The _d_i_s_a_r_m trait method undoes the changes caused by the _a_r_m trait method. A cascade button widget must call _d_i_s_a_r_m whenever the user unposts a Pulldown menu. The _d_i_s_a_r_m trait method undoes the actions performed by the _a_r_m trait method. That is, if _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is armed, then the _d_i_s_a_r_m trait method makes current the active item that had the focus before the menu was armed. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the menu widget to disarm. The XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget must have the XXXXmmmmNNNNrrrroooowwwwCCCCoooolllluuuummmmnnnnTTTTyyyyppppeeee resource set to XXXXmmmmMMMMEEEENNNNUUUU____BBBBAAAARRRR. TTTThhhheeee tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmm TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmm( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); Your child button widget should call the tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmm trait method when both of the following are true: +o If your child's parent was a TearOff Menu container and it has already been torn off +o The user has selected your child widget as the initial selection The tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmm trait method places the menu system into an active state by setting up grabs. After doing this, the tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmmtrait method itself calls the mmmmeeeennnnuuuuAAAArrrrmmmm trait method. Upon completion of the mmmmeeeennnnuuuuAAAArrrrmmmm trait method the tttteeeeaaaarrrrOOOOffffffffAAAArrrrmmmmtrait method sets up modal grabs. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the menu widget to arm. TTTThhhheeee eeeennnnttttrrrryyyyCCCCaaaallllllllbbbbaaaacccckkkk TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd eeeennnnttttrrrryyyyCCCCaaaallllllllbbbbaaaacccckkkk( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt cccchhhhiiiillllddddBBBBuuuuttttttttoooonnnnWWWWiiiiddddggggeeeetttt, XXXXttttPPPPooooiiiinnnntttteeeerrrr ccccaaaallllllll____vvvvaaaalllluuuueeee); A button widget that supports an activate callback must call the eeeennnnttttrrrryyyyCCCCaaaallllllllbbbbaaaacccckkkk trait method. More specifically, a button widget must call this trait method when the user activates the button. This trait method calls the entry callback of _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t. The entry callback of the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t is defined by the value of the XXXXmmmmNNNNeeeennnnttttrrrryyyyCCCCaaaallllllllbbbbaaaacccckkkk resource. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Page 8 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) Specifies the menu widget. _c_h_i_l_d_B_u_t_t_o_n_W_i_d_g_e_t Specifies the child menu widget that the user has activated. _c_a_l_l__v_a_l_u_e Specifies the client data to pass to the entry callback. TTTThhhheeee uuuuppppddddaaaatttteeeeHHHHiiiissssttttoooorrrryyyy TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd BBBBoooooooolllleeeeaaaannnn uuuuppppddddaaaatttteeeeHHHHiiiissssttttoooorrrryyyy( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt cccchhhhiiiillllddddBBBBuuuuttttttttoooonnnnWWWWiiiiddddggggeeeetttt, BBBBoooooooolllleeeeaaaannnn uuuuppppddddaaaatttteeeeOOOOnnnnMMMMeeeemmmmWWWWiiiiddddggggeeeettttMMMMaaaattttcccchhhh); We do not recommend calling this trait method. The _c_h_i_l_d_B_u_t_t_o_n_W_i_d_g_e_t should call this trait method from the widget's _i_n_i_t_i_a_l_i_z_e and sssseeeetttt____vvvvaaaalllluuuueeeessss methods. This trait method updates the value of the XXXXmmmmNNNNmmmmeeeennnnuuuuHHHHiiiissssttttoooorrrryyyy resource of the _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the RowColumn widget that is the parent of your button widget. _c_h_i_l_d_B_u_t_t_o_n_W_i_d_g_e_t Specifies the button widget calling this trait method. _u_p_d_a_t_e_O_n_M_e_m_W_i_d_g_e_t_M_a_t_c_h Specifies False. This trait method returns _T_r_u_e if _c_h_i_l_d_B_u_t_t_o_n_W_i_d_g_e_t is in a Pulldown or Option Menu. Otherwise, it returns _F_a_l_s_e. TTTThhhheeee ggggeeeettttLLLLaaaassssttttSSSSeeeelllleeeeccccttttTTTToooopppplllleeeevvvveeeellll TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd ggggeeeettttLLLLaaaassssttttSSSSeeeelllleeeeccccttttTTTTooooppppLLLLeeeevvvveeeellll( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); We do not recommend calling this trait method. Menu button widgets need to call this trait method immediately prior to arming themselves. That is, a menu button widget should call the ggggeeeettttLLLLaaaassssttttSSSSeeeelllleeeeccccttttTTTTooooppppLLLLeeeevvvveeeellll trait method from its AAAArrrrmmmm or AAAArrrrmmmmAAAAnnnnddddAAAAccccttttiiiivvvvaaaatttteeee methods. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the RowColumn widget that is the parent of your button widget. Page 9 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) TTTThhhheeee ppppoooossssiiiittttiiiioooonnnnMMMMeeeennnnuuuu TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd ppppoooossssiiiittttiiiioooonnnnMMMMeeeennnnuuuu( WWWWiiiiddddggggeeeetttt ppppooooppppuuuuppppMMMMeeeennnnuuuuPPPPaaaannnneeeeWWWWiiiiddddggggeeeetttt, XXXXBBBBuuuuttttttttoooonnnnPPPPrrrreeeesssssssseeeeddddEEEEvvvveeeennnntttt ****bbbbuuuuttttttttoooonnnneeeevvvveeeennnntttt); You may need to call the ppppoooossssiiiittttiiiioooonnnnMMMMeeeennnnuuuu trait method from your cascade button widget. The ppppoooossssiiiittttiiiioooonnnnMMMMeeeennnnuuuu trait method positions a Popup MenuPane by using the information in the specified event. The _p_o_p_u_p_M_e_n_u_P_a_n_e_W_i_d_g_e_t uses the _x__r_o_o_t and _y__r_o_o_tvalues in the specified _b_u_t_t_o_n_e_v_e_n_t to determine the menu position. Note that the ppppoooossssiiiittttiiiioooonnnnMMMMeeeennnnuuuu trait method works almost identically to the XXXXmmmmMMMMeeeennnnuuuuPPPPoooossssiiiittttiiiioooonnnn. The only difference between the two is that XXXXmmmmMMMMeeeennnnuuuuPPPPoooossssiiiittttiiiioooonnnn requires its first argument to be an XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget, but ppppoooossssiiiittttiiiioooonnnnMMMMeeeennnnuuuu can accept any menu manager. _p_o_p_u_p_M_e_n_u_P_a_n_e_W_i_d_g_e_t Specifies the Popup menu to be positioned. Typically, this will be an XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget. _b_u_t_t_o_n_e_v_e_n_t Specifies a pointer to the button event that caused the menu to pop up. TTTThhhheeee uuuuppppddddaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggssss TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd uuuuppppddddaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggssss( WWWWiiiiddddggggeeeetttt wwwwiiiiddddggggeeeetttt, iiiinnnntttt mmmmooooddddeeee); Your button _w_i_d_g_e_t must call the uuuuppppddddaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggssss trait when its accelerator or mnemonic changes. Calling this trait method informs the menu parent widget of any changes to accelerators or mnemonics. _w_i_d_g_e_t Specifies a widget. Ordinarily, this will be a menu child widget. _m_o_d_e Specifies whether an accelerator or mnemonic has been added, removed, or replaced. You should specify one of the following constants: XXXXmmmmAAAADDDDDDDD, XXXXmmmmDDDDEEEELLLLEEEETTTTEEEE, or XXXXmmmmRRRREEEEPPPPLLLLAAAACCCCEEEE. TTTThhhheeee rrrreeeeccccoooorrrrddddPPPPoooossssttttFFFFrrrroooommmmWWWWiiiiddddggggeeeetttt TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd rrrreeeeccccoooorrrrddddPPPPoooossssttttFFFFrrrroooommmmWWWWiiiiddddggggeeeetttt( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt, WWWWiiiiddddggggeeeetttt ccccaaaassssccccaaaaddddeeeeBBBBuuuuttttttttoooonnnnWWWWiiiiddddggggeeeetttt, BBBBoooooooolllleeeeaaaannnn aaaattttttttaaaacccchhhh); We do not recommend writing your own cascade button widget, but if you do, you will need to call the Page 10 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) rrrreeeeccccoooorrrrddddPPPPoooossssttttFFFFrrrroooommmmWWWWiiiiddddggggeeeetttt. This trait method signals that a MenuPane has either been attached to or detached from a cascade button. _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t Specifies the RowColumn widget containing the Popup Menu. _c_a_s_c_a_d_e_B_u_t_t_o_n_W_i_d_g_e_t Specifies a cascade button widget. _a_t_t_a_c_h This is a BBBBoooooooolllleeeeaaaannnn value. If _T_r_u_e, the _c_a_s_c_a_d_e_B_u_t_t_o_n_W_i_d_g_e_tis signaling that a MenuPane has been attached to a cascade button widget. If _F_a_l_s_e, the _c_a_s_c_a_d_e_B_u_t_t_o_n_W_i_d_g_e_t is signaling that a MenuPane has been detached from a cascade button widget. TTTThhhheeee ppppooooppppddddoooowwwwnnnnEEEEvvvveeeerrrryyyyoooonnnneeee TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd ppppooooppppddddoooowwwwnnnnEEEEvvvveeeerrrryyyyoooonnnneeee( WWWWiiiiddddggggeeeetttt mmmmeeeennnnuuuuSSSShhhheeeellllllllWWWWiiiiddddggggeeeetttt, XXXXEEEEvvvveeeennnntttt ****eeeevvvveeeennnntttt); The ppppooooppppddddoooowwwwnnnnEEEEvvvveeeerrrryyyyoooonnnneeee trait method pops down all the Popup Menus associated with _m_e_n_u_S_h_e_l_l_W_i_d_g_e_t, from bottom to top. _m_e_n_u_S_h_e_l_l_W_i_d_g_e_t Specifies the menu shell widget. _e_v_e_n_t Specifies a pointer to the event causing the popdown. TTTThhhheeee cccchhhhiiiillllddddFFFFooooccccuuuussss TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd vvvvooooiiiidddd cccchhhhiiiillllddddFFFFooooccccuuuussss( WWWWiiiiddddggggeeeetttt mmmmeeeennnnuuuuCCCChhhhiiiillllddddWWWWiiiiddddggggeeeetttt); The cccchhhhiiiillllddddFFFFooooccccuuuussss trait method gives _m_e_n_u_C_h_i_l_d_W_i_d_g_e_t the keyboard focus. This trait method performs other special handling to ensure that traversal ignores the focus change. This is needed so that keyboard actions (for example, <<<<oooossssffffSSSSeeeelllleeeecccctttt>>>> or <<<<oooossssffffHHHHeeeellllpppp>>>>) may be taken during the drag. _m_e_n_u_C_h_i_l_d_W_i_d_g_e_t Specifies the menu child widget. TTTThhhheeee ggggeeeettttPPPPooooppppuuuuppppPPPPoooosssstttteeeedddd TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd WWWWiiiiddddggggeeeetttt ggggeeeettttPPPPooooppppuuuuppppPPPPoooosssstttteeeedddd( WWWWiiiiddddggggeeeetttt rrrroooowwwwCCCCoooolllluuuummmmnnnnWWWWiiiiddddggggeeeetttt); Each _r_o_w_C_o_l_u_m_n_W_i_d_g_e_t maintains one shell to encompass all of its Popup Menus. Use the ggggeeeettttPPPPooooppppuuuuppppPPPPoooosssstttteeeedddd trait method to get the widget identifier of that shell. Page 11 (printed 4/6/01) XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTmmmmeeeennnnuuuuSSSSyyyysssstttteeeemmmm((((3333XXXX)))) _m_e_n_u_C_h_i_l_d_W_i_d_g_e_t Specifies the XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn widget managing your button widget. This trait method returns the widget identifier of the shell managing the posted Popup Menu. RRRREEEELLLLAAAATTTTEEEEDDDD XXXXmmmmRRRRoooowwwwCCCCoooolllluuuummmmnnnn(3), XXXXmmmmCCCCaaaassssccccaaaaddddeeeeBBBBuuuuttttttttoooonnnn(3), XXXXmmmmPPPPuuuusssshhhhBBBBuuuuttttttttoooonnnn(3), XXXXmmmmDDDDrrrraaaawwwwnnnnBBBBuuuuttttttttoooonnnn(3), XXXXmmmmAAAArrrrrrrroooowwwwBBBBuuuuttttttttoooonnnn(3), XXXXmmmmPPPPuuuusssshhhhBBBBuuuuttttttttoooonnnnGGGGaaaaddddggggeeeetttt(3), XXXXmmmmAAAArrrrrrrroooowwwwBBBBuuuuttttttttoooonnnnGGGGaaaaddddggggeeeetttt(3) and XXXXmmmmMMMMeeeennnnuuuuPPPPoooossssiiiittttiiiioooonnnn(3). Page 12 (printed 4/6/01)